#include "../Include/LogFunc.h"

IMPLEMENT_UNMANED_SINGLETON_X(CLogSystem)


CLogSystem::CLogSystem()
	:m_nLogLevel(ELogLevel::LOG_LEVEL_DUMP | ELogLevel::LOG_LEVEL_INFO | LOG_LEVEL_ERROR),
	m_bSaveToFile(false),
	m_strFileName(""),
	m_strLocalIp("127.0.0.1"),
	m_nLocalPort(6666)
{
	m_nDivideSize = 1024 * 1024 * 10;
}

CLogSystem::~CLogSystem()
{

}

void CLogSystem::SetLogLevel(int nLogLevel)
{
	m_nLogLevel |= nLogLevel;
}

void CLogSystem::SetFileName(bool bSaveToFile, const std::string& strfileName)
{
	m_bSaveToFile = bSaveToFile;
	m_strFileName = strfileName;
}

void CLogSystem::SetLoaclPort(int nLocalPort, const std::string& strLocalIp)
{
	m_strLocalIp = strLocalIp;
	m_nLocalPort = nLocalPort;
}

void CLogSystem::SetDivideSize(int nDivideSize)
{
	m_nDivideSize = nDivideSize;
}

int CLogSystem::GetLogLevel() const
{
	return m_nLogLevel;
}